<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <meta name="author" content="blog.anchen8.net" />

    <title>无标题 4</title>
</head>
<link rel="stylesheet" href="__CSS__/pintuer.css"/>
<link rel="stylesheet" href="__CSS__/admin.css"/>
<script src="__JS__/jquery.js"></script>
<script src="__JS__/pintuer.js"></script>
<script src="__JS__/jquery-1.11.3.js"></script>
<script src="__JS__/jquery.validate.js"></script>
<script src="__JS__/messages_zh.js"></script>
<script src="__JS__/ajaxfileupload.js"></script>
<script src="__JS__/layer/layer.js"></script>
<body>
<form  action="{:url('Reception/update')}?reception_id={$reception_id}" method="post" target='ifr'>
    <div class="panel admin-panel">
        <div class="panel-head"><strong class="icon-reorder"> 内容列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
        <table class="table table-hover text-center">
            <tr>
                <th width="100" style="text-align:left; padding-left:20px;">ID</th>
                <th width="20%">用户名字</th>
                <th width="20%">用户密码</th>
                <th width="20%" >用户状态</th>
                <th width="15%">用户注册时间</th>
                <th width="370">操作</th>
            </tr>
            {volist name="bo" id="v"}
            <tr>
                <td style="text-align:left; padding-left:20px;">{$v.id}</td>
                <td width="10%">{$v.username}</td>
                <td>{$v.password}</td>
                <td><button  class="checkbox" id="box" value="{$v.tate}" name="tate" style="cursor:pointer;height:46px;width:96px;position: absolute;margin-top:-15px;z-index:21;opacity: 0;margin-left:-10px;" ></button>
                <input   value="授权" name="tate" class="button bg-main" type="submit" id="checkbox" style="position:relative;margin-top:-10px;margin-left:-5px;height:40px;width:90px;"></td>
                <td>{$v.time}</td>
                <td>
                    <div class="button-group">
                        <a class="button border-main" style="cursor:pointer"><span class="icon-edit" >详情</span></a>
                        <a class="button border-red" href="{:url('Reception/reception_delete')}?reception_id={$reception_id}" onclick="return del(1,1,1)">
                            <span class="icon-trash-o"></span> 删除</a>
                    </div>
                </td>
            </tr>
            {/volist}
            <tr></tr>
            <tr>
                <td></td>
                <td colspan="8"><div class="pagelist"></div></td>
                <td></td><td></td>
            </tr>
        </table>
    </div>
</form>
<iframe name='ifr' id="ifr" style='display: none;'></iframe>
</body>
</html>
<script type="text/javascript">
    var iframe=document.getElementById("ifr");
    iframe.onload= function () {
        var bodycontent=iframe.contentDocument.body.innerHTML;
        console.log(bodycontent);
        //处理获取到的内容；
    }

    $(".icon-edit").click(function(){//利用layer弹出框展示信息
        layer.alert('<td>用户名:{$v.username}</td><br>'+
                '<td>用户密码:{$v.password}</td><br>'+
                '<td>用户邮箱:{$v.mail}</td><br>'+
                '<td>用户电话:{$v.phone}</td><br>'+
                '<td>注册时间:{$v.time}</td><br>');
    });
    $(".checkbox").click(function() { //利用js控制input标签内的内容

        var a = document.getElementById("box").value;
        if (a == "0") {
            document.getElementById("box").value = "1";
            document.getElementById("checkbox").value = "未授权";
            document.getElementById("checkbox").style.backgroundColor = "red";
        } else if (a == "1") {
            document.getElementById("box").value = "0";
            document.getElementById("checkbox").value = "授权";
            document.getElementById("checkbox").style.backgroundColor = "#1D9CCC";
        }
    });


</script>